<html>
<head><meta charset="utf-8"><title>cargo#8628 - Building cdylibs and plugins with cargo · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html">cargo#8628 - Building cdylibs and plugins with cargo</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="220380791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220380791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220380791">(Dec 18 2020 at 14:54)</a>:</h4>
<p>Hey hey, <a href="https://github.com/rust-lang/cargo/issues/8628">https://github.com/rust-lang/cargo/issues/8628</a> has been open for a while and it seems like more people are running into this issue. Does anyone from the Cargo team have time to look at it and provide some feedback? (Or maybe it can be discussed in a meeting? Whatever works best for y'all.)</p>



<a name="220389869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220389869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220389869">(Dec 18 2020 at 16:03)</a>:</h4>
<p><span class="user-mention" data-user-id="310399">@Mara</span> FWIW the next steps on that are probably either a concrete proposal with a request of "would it make sense to PR this?" or an RFC describing the proposal. Reading over the issue a new <code>[[clib]]</code> or similar section sounds like a great idea to me, and I would suspect that this would be best followed up with an RFC describing the proposal in more detail. The implementation here is likely not the hardest thing in the world (mostly just copying what <code>[[bin]]</code> does in Cargo since there doesn't seem to be anything radically different about the proposed <code>[[clib]]</code></p>



<a name="220389914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220389914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220389914">(Dec 18 2020 at 16:03)</a>:</h4>
<p>The RFC could also discuss the extension to customize the output  filename perhaps too?</p>



<a name="220390617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220390617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220390617">(Dec 18 2020 at 16:07)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span>  The third comment there is already a proposal: <a href="https://github.com/rust-lang/cargo/issues/8628#issuecomment-704295253">https://github.com/rust-lang/cargo/issues/8628#issuecomment-704295253</a></p>
<p>I guess all the small details are best figured out on a PR with an implementation, so there's something concrete to discuss. Just wanted to know if this looks okay to the team before I start working on that.</p>



<a name="220390659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220390659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220390659">(Dec 18 2020 at 16:07)</a>:</h4>
<p>How does it work with stability in cargo? Can things like this be added in some unstable way first?</p>



<a name="220392782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220392782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220392782">(Dec 18 2020 at 16:21)</a>:</h4>
<p><em>reads comment</em></p>



<a name="220392911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220392911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220392911">(Dec 18 2020 at 16:22)</a>:</h4>
<p>Personally I think this is fine to do in a PR, but others on the team may feel differently</p>



<a name="220392975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220392975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220392975">(Dec 18 2020 at 16:22)</a>:</h4>
<p>I've always thought cdylib in <code>[lib]</code> was a bit odd</p>



<a name="220393016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220393016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220393016">(Dec 18 2020 at 16:22)</a>:</h4>
<p>it might be good to see how others feel (or wait for us to discuss in a meeting) to determine PR-or-RFC-first perhaps?</p>



<a name="220393091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220393091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220393091">(Dec 18 2020 at 16:23)</a>:</h4>
<p>As for stability, this would likely be an unstable feature of the manifest, which we should have support for already. You'd just gate any new manifest directives and that way they would require explicit opt-in which only works on nightly</p>



<a name="220393151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220393151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220393151">(Dec 18 2020 at 16:23)</a>:</h4>
<p>I'd be ok with a PR firs, with a RFC before stablezing.</p>



<a name="220393388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220393388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220393388">(Dec 18 2020 at 16:25)</a>:</h4>
<p>alright. I'll experiment a bit with an implementation then. that hopefully also gives a bit more insight into the details for the RFC :)</p>



<a name="220393428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220393428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220393428">(Dec 18 2020 at 16:25)</a>:</h4>
<p>thanks for the feedback</p>



<a name="220395008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220395008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220395008">(Dec 18 2020 at 16:36)</a>:</h4>
<p>Personally that's my favorite kind of RFC, one where when you write the RFC you're basically done with the implementation</p>



<a name="220456977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220456977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220456977">(Dec 19 2020 at 06:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span> for having a separate <code>[[clib]]</code> for simplicity (I agree that conflating <code>[lib]</code> always seemed odd). But I'm curious, would it be backwards-compatible in TOML to do something like <code>[[lib]]</code>?</p>



<a name="220456979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220456979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220456979">(Dec 19 2020 at 06:31)</a>:</h4>
<p>(Leaving aside that there isn't a defined meaning for having multiple Rust-style libraries in one manifest.)</p>



<a name="220456980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220456980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220456980">(Dec 19 2020 at 06:31)</a>:</h4>
<p><span class="user-mention" data-user-id="310399">@Mara</span> I'm really excited for this. Thank you for working on it!</p>



<a name="220875569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220875569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220875569">(Dec 24 2020 at 15:26)</a>:</h4>
<blockquote>
<p>But I'm curious, would it be backwards-compatible in TOML to do something like <code>[[lib]]</code>?</p>
</blockquote>
<p>nope</p>



<a name="220882812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220882812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220882812">(Dec 24 2020 at 17:54)</a>:</h4>
<p><span class="user-mention" data-user-id="310399">@Mara</span> It isn't possible for cargo to parse either one? (I'm not asking if one toml file can contain both.)</p>



<a name="220883601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220883601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220883601">(Dec 24 2020 at 18:09)</a>:</h4>
<p>hm, with a custom deserializer, you could do it. one that accepts <code>lib</code> as both a struct/object and as a list of them. (but older versions of cargo wouldn't be able to parse <code>[[lib]]</code>)</p>



<a name="220883653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%238628%20-%20Building%20cdylibs%20and%20plugins%20with%20cargo/near/220883653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.238628.20-.20Building.20cdylibs.20and.20plugins.20with.20cargo.html#220883653">(Dec 24 2020 at 18:10)</a>:</h4>
<p>(but not really relevant here i suppose. as <code>[lib]</code> is for things that other crates can depend on, so having multiple of those wouldn't make sense anyway.)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>